package com.gouqi.lpl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gouqi.lpl.domain.PersionalStatistics;
import com.gouqi.lpl.mapper.PersionalStatisticsMapper;
import com.gouqi.lpl.service.PersionalStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class PersionalStatisticsServiceImpl extends ServiceImpl<PersionalStatisticsMapper, PersionalStatistics>
        implements PersionalStatisticsService {

    @Resource
    private PersionalStatisticsMapper persionalStatisticsMapper;

    @Override
    public List<PersionalStatistics> getPersionalStatistics() {
        LambdaQueryWrapper<PersionalStatistics> queryWrapper = new LambdaQueryWrapper<>();
        List<PersionalStatistics> persionalStatisticsList = persionalStatisticsMapper.selectList(queryWrapper);
        return persionalStatisticsList;
    }

    @Override
    public List<PersionalStatistics> getPersionalStatisticsByOrder() {
        LambdaQueryWrapper<PersionalStatistics> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderBy(true, false, PersionalStatistics::getKills);
        List<PersionalStatistics> persionalStatisticsList = persionalStatisticsMapper.selectList(queryWrapper);
        return persionalStatisticsList;
    }
}




